<?php

Class Student
{
    private $age;
    private $sex;
    private $name;
    static private $num;

    static function Num()
    {
        self::$num+=1;

        echo "当前有".self::$num."个学生"."<br>";
    }

    function __construct()
    {
        $this->age=16;
        $this->sex="男";
        $this->name="小猪";

        echo $this->name."加入PHP，";
        $this->Num();
    }

    function __set($name, $value)
    {
        $this->$name=$value;
    }

    function show()
    {
        echo "我叫".$this->name.",".$this->sex.",".$this->age."岁"."<br>";
        echo "我最喜欢打游戏，不想读书！"."<br>";
    }

    function __destruct()
    {
        echo "我挂科了,我是弟弟！"."<br>";
    }
}